<!--
 * @Description: 
 * @Version: 2.0
 * @Autor: snzo.chen
 * @Date: 2023-12-01 17:33:48
 * @LastEditors: snzo.chen
 * @LastEditTime: 2023-12-06 16:28:19
-->
<template>
  <div class="role-box">
    <a-radio-group v-model:value="roleId" name="radioGroup">
      <template v-for="item in roleOfData">
        <a-radio :value="item.id">{{ item.roleName }}</a-radio>
      </template>
    </a-radio-group>
  </div>
</template>
<script lang="ts" setup>
import { selectRoleByExample } from "@/api/system/role";
import { ref, onMounted } from "vue";
const props = defineProps({
  roleId: {
    type: Number,
    default: 0,
  },
});

const roleId = ref(props.roleId);
const roleOfData = ref<API.RoleItem[]>([]);

const loadRoleData = async () => {
  roleOfData.value = await selectRoleByExample({ isOpen: 1 });
};

onMounted(() => {
  loadRoleData();
});

defineExpose({
  roleId,
});
</script>
<style lang="less" scoped>
.role-box {
  padding: 30px 0;
}
</style>
